package org.aristotle.common.response.result;

public enum ResultCode implements CustomizeResultCode{

    QUERY_SUCCESS(200,"查询成功"),

    ADD_SUCCESS(201,"添加成功"),

    UPDATE_SUCCESS(201,"修改成功"),

    DELETE_SUCCESS(204,"删除成功"),

    BAD_REQUEST(400,"参数不合法"),

    UNAUTHORIZED(401,"未授权"),

    FORBIDDEN(403,"权限不足"),

    NOT_FOUND(404,"访问资源不存在"),


    CLIENT_AUTHENTICATION_FAILED(1001,"客户端认证失败"),
    USERNAME_OR_PASSWORD_ERROR(1002,"用户名或密码错误"),
    AUTH_SUCCESS(2000,"授权成功"),
    UNSUPPORTED_GRANT_TYPE(1003, "不支持的认证模式"),
    TOKEN_INVALID_OR_EXPIRED(1004, "token无效或已过期"),
    NO_PERMISSION(1005,"无权限访问！"),

    ACCESS_UNAUTHORIZED(1006, "访问未授权"),
    AUTHORIZED_ERROR(1007, "访问权限异常"),
    TOKEN_ACCESS_FORBIDDEN(1008,"token已被禁止访问"),

    ERROR(500,"服务器异常");

    private Integer code;

    private String msg;

    ResultCode(Integer code, String msg){
        this.code = code;
        this.msg = msg;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
